package com.battery.system.service.battery.impl;

import java.util.List;

import com.battery.system.service.impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.battery.system.mapper.DeviceStatusMapper;
import com.battery.system.domain.DeviceStatus;
import com.battery.system.service.battery.IDeviceStatusService;
import com.battery.common.core.text.Convert;

/**
 * 设备状态Service业务层处理
 *
 * @author battery
 * @date 2021-01-22
 */
@Service
public class DeviceStatusServiceImpl extends BaseServiceImpl<DeviceStatus> implements IDeviceStatusService {
    @Autowired
    private DeviceStatusMapper deviceStatusMapper;

    /**
     * 查询设备状态
     *
     * @param deviceId 设备状态ID
     * @return 设备状态
     */
    @Override
    public DeviceStatus selectDeviceStatusById(String deviceId) {
        return deviceStatusMapper.selectDeviceStatusById(deviceId);
    }

    /**
     * 查询设备状态列表
     *
     * @param deviceStatus 设备状态
     * @return 设备状态
     */
    @Override
    public List<DeviceStatus> selectDeviceStatusList(DeviceStatus deviceStatus) {
        return deviceStatusMapper.selectDeviceStatusList(deviceStatus);
    }

    /**
     * 新增设备状态
     *
     * @param deviceStatus 设备状态
     * @return 结果
     */
    @Override
    public int insertDeviceStatus(DeviceStatus deviceStatus) {
        return deviceStatusMapper.insertDeviceStatus(deviceStatus);
    }

    /**
     * 修改设备状态
     *
     * @param deviceStatus 设备状态
     * @return 结果
     */
    @Override
    public int updateDeviceStatus(DeviceStatus deviceStatus) {
        return deviceStatusMapper.updateDeviceStatus(deviceStatus);
    }

    /**
     * 删除设备状态对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteDeviceStatusByIds(String ids) {
        return deviceStatusMapper.deleteDeviceStatusByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除设备状态信息
     *
     * @param deviceId 设备状态ID
     * @return 结果
     */
    @Override
    public int deleteDeviceStatusById(String deviceId) {
        return deviceStatusMapper.deleteDeviceStatusById(deviceId);
    }
}
